package com.gengealogy.net.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gengealogy.net.dao.TreeDao;
import com.gengealogy.net.po.Tree;
import com.gengealogy.net.service.TreeService;

@Service("treeService")
@Transactional
public class TreeServiceImpl implements TreeService{
	@Autowired
	private TreeDao treeDao;
	
	public TreeDao getTreeDao() {
		return treeDao;
	}

	public void setTreeDao(TreeDao treeDao) {
		this.treeDao = treeDao;
	}

	@Override
	public Tree findTree(int tree_clan_id) {
		// TODO Auto-generated method stub
		return treeDao.findTree(tree_clan_id);
	}

	@Override
	public int addTree(Tree tree) {
		// TODO Auto-generated method stub
		return treeDao.addTree(tree);
	}

	@Override
	public Tree getTreeById(int tree_clan_id) {
		// TODO Auto-generated method stub
		return treeDao.getTreeById(tree_clan_id);
	}

	@Override
	public int updateTree(Tree tree) {
		// TODO Auto-generated method stub
		return treeDao.updateTree(tree);
	}

	@Override
	public int deleteTree(int tree_id) {
		// TODO Auto-generated method stub
		return 0;
	}


//		// 通过账号和密码查询用户
//		@Override
//		public User findUser(String username, String password) {
//			User user = this.userDao.findUser(username, password);
//			return user;
//		}
//		
//		@Override
//		public void register(User user) {
//			userDao.register(user);
//		}
//
//		@Override
//		public User getUserById(int user_id) {
//			// TODO Auto-generated method stub
//			return userDao.getUserById(user_id);
//		}
//
//		@Override
//		public int updateUser(User user) {
//			// TODO Auto-generated method stub
//			return userDao.updateUser(user);
//		}
//
//		@Override
//		public int deleteUser(int user_id) {
//			// TODO Auto-generated method stub
//			return userDao.deleteUser(user_id);
//		}
//	
	
}
